-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim parsed input group keys to remove whitespace #60
Trim parsed input group keys to remove whitespace #60
Conversation
Any thoughts on this small change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, been busy to review this. We'll also probably need to figure out releasing. The main branch has a lot of changes that has diverged a lot from what Video.js expects. I'll probably release from a branch when this gets merged in.
lib/parser/parse-options.js
Outdated
@@ -10,7 +10,7 @@ function parseOptions(input, callback, keyValueDelim, groupDelim) { | |||
if (kv.length !== 2) { | |||
continue; | |||
} | |||
var k = kv[0]; | |||
var k = kv[0].trim(); | |||
var v = kv[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a trim here too, just in case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look! Pushed up that change here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. I'll refrain from merging until I find a time to do a release. Unfortunately, it's unlikely to get in before August at this point. I'm off next week.
Did this make it into version 7.x yet? It's not trimmed in the online tester for 7.x: |
It's in 7.20.3 https://github.com/videojs/video.js/releases/tag/v7.20.3 |
Gotcha, thanks gkatsev! |
Just updated the version of video.js there (videojs/http-streaming#1340) it should be deployed in a few minutes. |
Thanks again! |
This PR introduces a minor adjustment to the keys parsed from each input group in
lib/parser/parseOptions.js
. This change will fix an issue first reported in videojs/http-streaming#982.Our video asset caption VTT files were generated in such a way that added an extra whitespace between the first group delimiter (
,
) and the key "LOCAL" (example below). This extra whitespace, while apparently in-compliance with the HLS-segmented VTT spec, causes VTT.js's parseOptions function to not properly parse cues from the VTT files, resulting in empty text tracks being attached to our player.Example
WORKING:
BROKEN: